const {defineConfig} = require('@vue/cli-service')
const path = require('path')

module.exports = defineConfig({
  transpileDependencies: true,
  productionSourceMap: false,
  terser: {
    terserOptions: {
      compress: {
        drop_console: true,
        drop_debugger: true
      }
    }
  },
  chainWebpack: (config) => {
    config.module.rule('svg').exclude.add(path.resolve(__dirname, 'src/assets/icons')).end()
    config.module
        .rule('icons')
        .test(/\.svg$/)
        .include.add(path.resolve(__dirname, 'src/assets/icons'))
        .end()
        .use('svg-sprite-loader')
        .loader('svg-sprite-loader')
        .options({
          symbolId: 'icon-[name]'
        })
        .end()
  }
})
